<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
</head>
<body>
	<script type="text/javascript">
		//随机数 [0,1)
		console.log(Math.random())

		//圆周率
		console.log(Math.PI)

		console.log("四舍五入",Math.round(10.6)) //11

		console.log("向上取整",Math.ceil(10.1)) //11

		console.log("向下取整",Math.floor(10.9)) //10

		console.log("平方",Math.pow(10, 3)) //1000

		console.log("开根号",Math.sqrt(2)) //1.414

		console.log("最大值",Math.max(1,2,3,4,5,6,7)) //7

		console.log("最小值",Math.min(1,2,3,4,5,6,7)) //1

		//取小数 toFixed(保留几位小数)
		let a = 9.233333
		console.log(a.toFixed(2)) //9.23

		// 3 4
		console.log("勾股定理： a^2 + b^2 = c^2")
		console.log(Math.sqrt(Math,pow(3,2) + Math.pow(4,2)))
	</script>
</body>
</html>] 